Ext.namespace("yft.posMachine");
var posMachineListStore_1 = new Ext.data.JsonStore({
		url:basepath+"/yft/posMachine/getPosMachineList.html",
		root:'root',
		totalProperty:'totalProperty',  
		fields:[
				{name: 'id'},
				{name: 'pattern'},
				{name: 'channelName'},
				{name: 'modelName'},
				{name: 'typeName'},
				{name: 'posStatus'},
				{name: 'machineSnCode'},
				{name: 'terminalSn'},
				{name: 'passwordKeySn'},
				{name: 'simSn'},
				{name: 'merchantName'},
				{name: 'isRecycle'}
		]
	});	


function posMachineSearch_1(){
	var name = Ext.util.Format.trim(Ext.getCmp('se_name').getValue());
	posMachineListStore_1.baseParams['name'] = name;
	posMachineListStore_1.removeAll();
	posMachineListStore_1.load({params:{start: 0,limit: colNum1}});
}

yft.posMachine.posMachineListPanel =Ext.extend(Ext.Panel, {
	anthArray:'',
	closable : true,
	autoScroll : true,
	width:'auto',
	layout : "fit",
	gridViewConfig : {
		animate : true
	},
	maskDisabled : false,
	bodyStyle:my_scroll_cs,
	initComponent : function() {
		yft.posMachine.posMachineListPanel.superclass.initComponent.call(this);
		var col =[
			{header:'型号',dataIndex:"modelName",sortable:true,align:'center',width:120},
			{header:'机型',dataIndex:"pattern",sortable:true,align:'center',width: 100},
			{header:'进货渠道',dataIndex:"channelName",sortable:true,align:'center',width: 100},
			{header:'业务类型',dataIndex:"typeName",sortable:true,align:'center',width: 100},
			{header:'库存状态',dataIndex:"posStatus",sortable:true,align:'center',width: 100},
			{header:'终端序列号',dataIndex:"machineSnCode",sortable:true,align:'center',width: 100},
			{header:'终端号',dataIndex:"terminalSn",sortable:true,align:'center',width: 100},
			{header:'密码键盘号',dataIndex:"passwordKeySn",sortable:true,align:'center',width: 100},
			{header:'移动sim卡号',dataIndex:"simSn",sortable:true,align:'center',width: 100},
			{header:'商户名',dataIndex:"merchantName",sortable:true,align:'center',width: 100},
			{header:'是否回收',dataIndex:"isRecycle",sortable:true,align:'center',width: 100}
		];
		
		var toolBar =[
			'-',
			new Ext.Toolbar.Fill(),
			'名称:&nbsp;',
			{
				xtype : 'textfield',
				id : 'se_name',
				width : 90
			},'&nbsp;','-',{
				text : '查询',
//				iconCls : 'search',
				pressed : false,
				handler : posMachineSearch_1,
				scope : this
			},'-'
		];
		var posMachineListGridPanel_1 = new Ext.grid.GridPanel({
			store : posMachineListStore_1,
			columns : col,
			//clicksToEdit:1, 
			//autoExpandColumn : 7,
			pageSize : colNum1,
			myRightclickMenu: [
			],
			loadMask : new Ext.LoadMask(Ext.getBody(),{msg:"数据加载中..."}),
			tbar :toolBar,
			bbar : new Ext.PagingToolbar({
				pageSize : colNum1,
				store : posMachineListStore_1,
				displayInfo:true,
				displayMsg:'<span>显示第<span style="color:green;font-size:12px;font-weight:bold;">{0}</span>条到第<span style="color:blue;font-size:12px;font-weight:bold;">{1}</span>条记录，一共<span style="font-weight:bold;color:red;font-size:12px">{2}</span>条记录</a>',
				emptyMsg:'<span style="color:red">没有查询到相关信息<span>'
			})
		});
		posMachineListStore_1.load({params:{start: 0,limit: colNum1}});
		this.add(posMachineListGridPanel_1);
	}
});
